package com.blog.webSrc.services;

import com.blog.common.model.BlogUser;
import com.jfinal.plugin.activerecord.Db;

public class BlogUserServices {
	public static final BlogUserServices me = new BlogUserServices();
	private static final BlogUser dao = new BlogUser().dao();
	
	public BlogUser findById(Object idValue){
		return dao.findById(idValue);
	}
	
	public BlogUser findbyUserName(String username){
		String sql = "SELECT * FROM blog_user where user_name = ? ";
		return dao.findFirst(sql, username);
	}
	
	/**重置密码*/
	public boolean updatePwd(Object user_name,String newPass){
		String sql = "update blog_user set user_pwd = ? where user_name = ?";
		if(Db.update(sql,newPass,user_name)>0){
			return true;
		}
		return false;
	}
}
